using UnityEngine;

public class SnailSkillState : BaseState
{
  public override void OnEnter(Enemy enemy)
  {
    curEnemy = enemy;
    curEnemy.curSpeed = 0;
    curEnemy.anim.SetBool("hide", true);
    curEnemy.anim.SetTrigger("skill");

    curEnemy.lostTimeCounter = curEnemy.lostTime;

    curEnemy.GetComponent<Character>().invulnerable = true;
  }

  public override void LogicUpdate()
  {
    if (curEnemy.lostTimeCounter <= 0)
      curEnemy.SwitchState(NPCState.Patrol);

    curEnemy.GetComponent<Character>().invulnerableCounter = curEnemy.lostTimeCounter;
  }

  public override void PhysicsUpdate()
  {
  }

  public override void OnExit()
  {
    curEnemy.anim.SetBool("hide", false);
    curEnemy.GetComponent<Character>().invulnerable = false;
  }

}
